﻿<%@ Page Title="" Language="VB" MasterPageFile="~/App/Master/App.master" AutoEventWireup="false" CodeFile="Main.aspx.vb" Inherits="App_Main" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CphHead" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CphMainContent" runat="Server">
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <asp:Button runat="server" ID="BntImport" Text="Visualizza Tweets" />
    <asp:Button runat="server" ID="BtnFoll" Text="Importa Followers" />
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# eval("text") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# eval("created_at") %>'></asp:Label>
                    <asp:Label runat="server" Text='<%# DataBinder.eval(Container,"RowIndex" ) +1 %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <%--      <img src="<%# eval("profile_image_url") %>" />--%>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <hr />
    <asp:Button runat="server" ID="BtnFollTweets" Text="Importa Tweets follower" />
    <asp:Button runat="server" ID="BtnHashTag" Text="Aggiorna hashtag" />
    <hr />
    <asp:TextBox runat="server" ID="TxtQuery"></asp:TextBox>
    <asp:Button runat="server" ID="BtnCreateQuery" Text="Elabora query" />
    <asp:DropDownList ID="DdlQuery" runat="server">
    </asp:DropDownList>
    <asp:Button ID="BntViewQuery" runat="server" Text="Visualizza query" />
    <div style="width: 650px; border: 1px solid; padding: 3px; float: left;">
        <asp:Repeater runat="server" ID="RptHashtagQuery">
            <ItemTemplate>
                <span style="font-size: <%#  int((13 + Eval("dim")))%>px;">
                    <asp:LinkButton runat="server"  ToolTip='<%# eval("post_count") %>' Text='<%# eval("hashtag") %>'></asp:LinkButton>
                </span>
            </ItemTemplate>
        </asp:Repeater>
    </div>
    <hr />
    <asp:UpdatePanel runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <div>
                <div style="width: 450px; border: 1px solid; padding: 3px; float: left;">
                    <asp:Repeater runat="server" ID="RptHasttag">
                        <ItemTemplate>
                            <span style="font-size: <%#  int((13 + Eval("dim")))%>px;">
                                <asp:LinkButton runat="server" CommandArgument='<%# eval("id") %>' ToolTip='<%# eval("follower_post_count") %>' Text='<%# eval("hashtag") %>'></asp:LinkButton>
                            </span>
                        </ItemTemplate>
                    </asp:Repeater>
                </div>
                <div style="width: 150px; border: 1px solid; padding: 3px; float: left;">
                    <ul>
                        <asp:Repeater runat="server" ID="RptHasttagSel">
                            <ItemTemplate>
                                <li>
                                    <asp:LinkButton runat="server" CommandArgument='<%# eval("id") %>' Text='X'></asp:LinkButton>
                                    <%# eval("hashtag") %></li>
                            </ItemTemplate>
                        </asp:Repeater>
                    </ul>
                </div>
            </div>
            <div class="return">
                Numero minimo tweets con tag:<br />
                <asp:TextBox runat="server" ID="TxtTweetsMin" Text="10"></asp:TextBox><br />
                <asp:Button runat="server" ID="BtnSearch" Text="Ricerca utenti" />
            </div>
            <hr />
            <div style="width: 650px; border: 1px solid; padding: 3px; float: left;">
                <asp:Repeater runat="server" ID="RptHasttagFilter">
                    <ItemTemplate>
                        <span style="font-size: <%#  int((13 + Eval("dim")))%>px;">
                            <asp:LinkButton runat="server" CommandArgument='<%# eval("hashtag_id") %>' ToolTip='<%# eval("tot_tag") %>' Text='<%# eval("hashtag") %>'></asp:LinkButton>
                        </span>
                    </ItemTemplate>
                </asp:Repeater>
            </div>
            <hr />
            <h2>
                <asp:Label runat="server" ID="LblUserFound" Text="" />
            </h2>
            <asp:GridView ID="GridUsers" runat="server" AutoGenerateColumns="False" AllowSorting="true" AllowPaging="True" Width="100%">
                <Columns>
                    <asp:TemplateField HeaderText="Nome" SortExpression="fullname">
                        <ItemTemplate>
                            <asp:HyperLink runat="server" NavigateUrl='<%# "https://twitter.com/" & eval("username") %>' Target="_blank">
                                <asp:Label runat="server" Text='<%# eval("fullname") %>'></asp:Label>
                            </asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="image">
                        <ItemTemplate>
                            <asp:HyperLink runat="server" NavigateUrl='<%# eval("url") %>' Target="_blank">
                                <img src="<%# eval("avatar") %>" />
                            </asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="description" SortExpression="description">
                        <ItemTemplate>
                            <asp:Label runat="server" Text='<%# eval("description") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="location" SortExpression="location">
                        <ItemTemplate>
                            <asp:Label runat="server" Text='<%# eval("location") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="follower" SortExpression="follower_count">
                        <ItemTemplate>
                            <asp:Label runat="server" Text='<%# eval("follower_count") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="tweets" SortExpression="Post_Count">
                        <ItemTemplate>
                            <asp:Label runat="server" Text='<%# eval("Post_Count") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="con tag" SortExpression="tot_post">
                        <ItemTemplate>
                            <asp:Label runat="server" Text='<%# eval("tot_post") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <hr />
            <asp:GridView ID="GridUserResults" runat="server" AutoGenerateColumns="False">
                <Columns>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# eval("fullname") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# eval("tot_post") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
